package fr.umlv.m2.jee.pmlv.persistence.planning;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Represents a classroom in the university.
 * @author jenseric
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name="Classroom")
public class Classroom implements Serializable {
	
	/**The id of the classroom.*/
	@Id
	@GeneratedValue
	@Column(name="classroom_id")
	private long id;
	/**the name of the classroom.*/
	
	/**The number of the classroom.*/
	@Column(name="classroom_number")
	private String number;
	
	/**The number max of places in the classroom.*/
	@Column(name="classroom_numberOfPlaces")
	private long numberOfPlaces;
	
	/**THe building where is the classroom.*/
	@Column(name="classroom_building")
	private String building;
	
	@OneToMany(mappedBy="classroom")
	/**List of event in the classroom*/
	private List<AbstractEvent> events;
	
	/**
	 * Sets the id of the class room.
	 * @param id the id to set.
	 */
	public void setId(long id) {
		this.id = id;
	}
	
	/**
	 * Returns the id of the classroom.
	 * @return the id of the classroom.
	 */
	public long getId() {
		return id;
	}
	
	/**
	 * Sets the number of the classroom.
	 * @param number the number to set
	 */
	public void setNumber(String number) {
		this.number = number;
	}
	
	/**
	 * Returns the number of the classroom.
	 * @return the number of the classroom.
	 */
	public String getNumber() {
		return number;
	}
	
	/**
	 * Sets the building where is the classroom.
	 * @param building the building to set.
	 */
	public void setBuilding(String building) {
		this.building = building;
	}
	
	/**
	 * Returns the building of the classroom.
	 * @return the building of the classroom.
	 */
	public String getBuilding() {
		return building;
	}
	
	/**
	 * Returns the number of places max in the classroom.
	 * @param numberOfPlace the number of places to set.
	 */
	public void setNumberOfPlaces(long numberOfPlaces) {
		this.numberOfPlaces = numberOfPlaces;
	}
	
	/**
	 * Returns the number of places in the classroom.
	 * @return the number of places in the classroom.
	 */
	public long getNumberOfPlaces() {
		return numberOfPlaces;
	}

	/**
	 * Sets the events associated by the classroom.
	 * @param events the list of events to be set.
	 */
	public void setEvents(List<AbstractEvent> events) {
		this.events = events;
	}

	/**
	 * Returns the list of events associated by the classroom.
	 * @return the list of events associated by the classroom.
	 */
	public List<AbstractEvent> getEvents() {
		return events;
	}
	
}
